﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebChat.Admin
{
    public partial class Chatters : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected string SafeEval(string propertyName)
        {
            string value = (string)Eval(propertyName);
            string safeValue = Server.HtmlEncode(value);

            return safeValue;
        }

        WebChatDAL.WebChatDAO dao = new WebChatDAL.WebChatDAO();

        protected string EvalUserName()
        {
            WebChat.Chatter chatter = (WebChat.Chatter)GetDataItem();

            WebChatDAL.Chatter dalChatter;
            if (dao.TryGetChatterByChatterId(chatter.ChatterId, out dalChatter))
            {
                return dalChatter.aspnet_Users.UserName;
            }

            return "unknown";
        }

    }
}